# global var
total = 0


def sum(a, b):
    global total
    total = a + b
    print("函数内部的total = %d " % (total))
    return total


def outer():
    num = 10

    def inner():
        nonlocal num
        num = 100
        print('内部num=', num)
    inner()
    print('外部num', num)


# outer()
# sum(2, 3)
# print("函数外部的total=%d" % (total))
g_n = 10


def tes():
    b = g_n + 1
    print(b)


tes()
